from zyb_caps import *

# XPATH定位

# 绝对路径
# driver.find_element(By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.ScrollView/android.widget.LinearLayout/android.widget.RelativeLayout[1]/android.widget.RelativeLayout/android.widget.EditText').send_keys('17534741512')
# driver.find_element(By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.ScrollView/android.widget.LinearLayout/android.widget.RelativeLayout[2]/android.widget.EditText').send_keys('zhang123.')
# driver.find_element(By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.ScrollView/android.widget.LinearLayout/android.widget.TextView[3]').click()
# sleep(3)
# driver.quit()

# 相对路径
driver.find_element(By.XPATH, '//android.widget.EditText@text="输入手机号码"]').send_keys('17534741512')
driver.find_element(By.XPATH, '//android.widget.EditText@text="请输入登录密码"]').send_keys('zhang123.')
driver.find_element(By.XPATH, 'android.widget.TextView').click()
sleep(3)
driver.quit()
